package name.hankc.spring.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import name.hankc.spring.service.DemoService;
import name.hankc.spring.service.impl.DemoServiceImpl;

@WebServlet(urlPatterns = "/demo1")
public class DemoServlet1 extends HttpServlet {

    private static final long serialVersionUID = -2175034707178439037L;
    DemoService demoService = new DemoServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.getWriter().println(demoService.findAll().toString());
    }
}